package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.ManufacturerDao;
import com.vne.skyemart.model.Manufacturer;
import com.vne.skyemart.service.ManufacturerService;

@Service("manufacturerService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class ManufacturerServiceImpl implements ManufacturerService{
	@Autowired
	private ManufacturerDao manufacturerDao;

	public ManufacturerDao getManufacturerDao() {
		return manufacturerDao;
	}

	public void setManufacturerDao(ManufacturerDao manufacturerDao) {
		this.manufacturerDao = manufacturerDao;
	}
	public ManufacturerServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addManufacturer(Manufacturer manufacturer) {
		manufacturerDao.save(manufacturer);
	}

	@Override
	public List<Manufacturer> listManufacturer() {
		return manufacturerDao.findAll();
	}
	
}
